home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / BTRIEVE / BTRTPW / TPWBTR.PAS
Pascal/Delphi Source File  |  1991-05-03  |  5KB  |  134 lines

  1. Unit TpwBtr;  
  2. {*****************************************************************}
  3. {Unit for Windows Btrieve to be called by Turbo Pascal For Windows}          
  4.  
  5. {This unit defines 3 Btrieve functions which can be called from   }
  6. {Windows, 1 for initializing either the local DLL or the requestor}
  7. {DLL, 1 for clearing an instance of Btrieve, and 1 for making     }
  8. {standard Btrieve operation calls.                                }
  9.                                                        
  10. {While you can make calls to the DLL functions directly, this unit}
  11. {can help make your Windows Btrieve calls look like those in Dos. }
  12. {If you choose to make direct calls to the DLL, just use the      }
  13. {external function definitions given in the implementation section}
  14. {below.                                                           }
  15.  
  16. {NOTE: This interface is a BETA version. Due to the demand for    }
  17. {for this document, it has not been through the normal testing    }
  18. {procedures. Please report any problems to Novell Technical       }
  19. {Support via Netwire on Compuserve (Account # 76701,171) or via   }
  20. {FAX (# 512-345-7478)                                             }
  21.  
  22. {*****************************************************************}
  23.  
  24.  
  25. Interface
  26.   {**********************************************************}
  27.   {These are the Btrieve functions called by your application}
  28.   {**********************************************************}
  29.  
  30.   {Standard Btrieve Operation Call}
  31.   Function Btrv(    Operation : integer;
  32.                 var PositionBlock,
  33.                     DataBuffer;
  34.                 var DataLen : word;
  35.                 var KeyBuffer;
  36.                     KeyNumber     : byte): integer;
  37.  
  38.   {Initializes the local DLL}
  39.   Function BtrvInit(Var InitializationString): Integer;
  40.  
  41.   {Stops this instance of Btrieve}
  42.   Function BtrvStop: Integer;
  43.  
  44.   {This function is currently not supported. You initialize brequest.exe
  45.    when you load it before loading Windows. Therefore, there is no need
  46.    to initialize the WBTRCALL.DLL requestor from your Windows application.
  47.    Separate initialization for each task using the requestor may be supported
  48.    at a later time.}
  49.    
  50.   Function BRqShellInit(Var InitializationString): Integer;
  51.  
  52. Implementation
  53.   {**********************************************************}
  54.   {Define all of the actual WBTRCALL.DLL functions           }
  55.   {**********************************************************}
  56.  
  57.   {Standard Btrieve Operation Call}
  58.   Function Btrcall (  Operation: integer;
  59.           var posblk,
  60.                       databuf;
  61.                   var datalen   : word;
  62.                   var keybuf;
  63.               keylen    :  byte;
  64.               keynum    :  byte): integer; far;
  65.                        external 'WBTRCALL'  index 1;
  66.  
  67.  
  68.   {This is a dummy function. It currently serves no purpose}
  69.   Function WBShellInit(Var InitializationString): Integer; far;
  70.                        external 'WBTRCALL'  index 2;
  71.  
  72.   {Initializes the local DLL}
  73.   Function WBtrvInit(Var IntializationString): Integer;  far;
  74.                        external 'WBTRCALL'  index 3;
  75.  
  76.   {Clears all internal Btrieve tables for this process}
  77.   Function WBtrvStop: Integer;  far;
  78.                        external 'WBTRCALL'  index 4;
  79.  
  80.   {This function is currently not supported. You initialize brequest.exe
  81.    when you load it before loading windows. Therefore, there is no need
  82.    to initialize the WBTRCALL.DLL requestor from your Windows application}
  83.   Function WBRqShellInit(Var InitializationString): Integer; far;
  84.                        external 'WBTRCALL'  index 5;
  85.  
  86.  
  87.  
  88.   {**********************************************************}
  89.   {Now define the functions which call the DLL               }
  90.   {**********************************************************}
  91.  
  92.   {Standard Btrieve Operation Call}
  93.   Function Btrv (   Operation   : integer;
  94.                 var PositionBlock,
  95.                     DataBuffer;
  96.                 var DataLen     : word;
  97.                 var KeyBuffer;
  98.                     KeyNumber   : byte): integer;
  99.   Var
  100.     KeyLen: Byte;
  101.  
  102.   Begin
  103.     KeyLen:= 255;                       {maximum key length}
  104.     Btrv := BtrCall(Operation,  PositionBlock,  DataBuffer,
  105.                     DataLen,    KeyBuffer,      KeyLen,
  106.                     KeyNumber);
  107.   End; {Btrv}
  108.  
  109.  
  110.   {Initializes the local DLL}
  111.   Function BtrvInit (Var InitializationString): Integer;
  112.   Begin
  113.     BtrvInit := WBtrvInit (InitializationString);
  114.   End; {End BtrvInit}
  115.  
  116.  
  117.   {Stops this instance of Btrieve}
  118.   Function BtrvStop: Integer;
  119.   Begin
  120.     BtrvStop:= WBtrvStop;
  121.   End; {End BtrvStop}
  122.  
  123.  
  124.   {Initializes the requestor DLL}
  125.   Function BRqShellInit(Var InitializationString): Integer;
  126.   Begin
  127.     BRqShellInit:= WBRqShellInit(InitializationString);
  128.   End; {End BRqShellInit}
  129.  
  130.  
  131. Begin
  132. End.
  133.  
  134.